<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page isELIgnored="false" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="cache-control" content="no-cache"/>
    <meta http-equiv="expires" content="0"/>
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3"/>
    <meta http-equiv="description" content="This is my page"/>

    <link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/static/css/base.css"/>
    <link href="${pageContext.request.contextPath}/static/css/daoke.css" rel="stylesheet" type="text/css"/>

    <link href="${pageContext.request.contextPath}/static/css/iconfont.css" rel="stylesheet" type="text/css"/>
    <script language="javascript">
        function check() {
            var oldPassword = document.getElementById("oldPassowrd").value;
            if (document.modPassword.oldPassword.value != oldPassword) {
                alert("原密码不正确");
                return;
            }

            if (document.modPassword.password.value == "") {
                alert("新密码不能空");
                return;
            }

            document.modPassword.submuserPw.jspit();
            window.parent.location = "${pageContext.request.contextPath}/login.jsp";
        }

    </script>
</head>

<body leftmargin="2" topmargin="9" >
<form method="post" action="${pageContext.request.contextPath}/admin/updateAdmin.html?id=${currentAdmin.id }"
      name="modPassword"
      id="modPassword">
    <table width="98%" align="center" border="0" cellpadding="0" cellspacing="0" bgcolor="#CBD8AC"
           style="margin-bottom:8px">
        <tr bgcolor="#E7E7E7" style="height: 30px;">
            <td colspan="2"  class='title'><span><i class="iconfont icon-xiugaimima font16"></i>密码修改</span>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" height="35">
            <td width="25%" bgcolor="#FFFFFF" align="right" style="font-size: 16px;">
                登录名：
            </td>
            <td width="75%" bgcolor="#FFFFFF">
                <input type="text" value="${currentAdmin.userName }" name="userName" size="20"
                       disabled="disabled" style="width: 225px;"/>
                <input type="hidden" value="${currentAdmin.password }" name="oldPassowrd" id="oldPassowrd" size="20"
                       disabled="disabled" style="width: 225px;"/>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" height="35">
            <td width="25%" bgcolor="#FFFFFF" align="right" style="font-size: 16px;">
                原密码：
            </td>
            <td width="75%" bgcolor="#FFFFFF">
                <input type="password" name="oldPassword" id="oldPassword" size="22" style="width: 225px;height: 30px;border-radius: 5px;"/>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" height="35">
            <td width="25%" bgcolor="#FFFFFF" align="right" style="font-size: 16px;">
                新密码：
            </td>
            <td width="75%" bgcolor="#FFFFFF">
                <input type="password" id="password" name="password" size="22" style="width: 225px;height: 30px;border-radius: 5px;"/>
            </td>
        </tr>
        <tr bgcolor="#FFFFFF" height="35">
            <td width="25%" bgcolor="#FFFFFF" align="right">
                &nbsp;
            </td>
            <td width="75%" bgcolor="#FFFFFF">
                <input type="button" value="修改" onclick="check()" style="width: 80px;height: 30px;box-sizing: border-box; border-radius: 5px;font-size: 16px;" />
                &nbsp;&nbsp;&nbsp;
                <input type="reset" value="重置" style="width: 80px;height: 30px;box-sizing: border-box; border-radius: 5px;font-size: 16px;" />
                <img id="indicator" alt="Loading..."
                     style="display:none"/>
            </td>
        </tr>
    </table>
</form>
</body>
</html>
